function Mesh = Mesh_struct_2d(left, right, bottom, top, Nx, Ny, basis_type)

Mesh.left = left;
Mesh.right = right;
Mesh.bottom = bottom;
Mesh.top = top;
Mesh.Nx = Nx;
Mesh.Ny = Ny;
Mesh.hx = (right-left)/Nx;
Mesh.hy = (top-bottom)/Ny;
Mesh.basis_type = basis_type;
[Mesh.node, Mesh.elem] = process_node_elem_2d(left, right, bottom, top, Nx, Ny, basis_type);
Mesh.Np = (Nx+1)*(Ny+1);
switch basis_type
    case {"P1", "P1b", "P2"}
        Mesh.Ne = 2*Nx*Ny;
    case{"Q1", "Q1b", "Q2"}
        Mesh.Ne = Nx*Ny;
    otherwise
        error('Invalid basis type');
end
switch basis_type
    case "P1"
        Mesh.Nb = Mesh.Np;
    case "P1b"
        Mesh.Nb = Mesh.Np + Mesh.Ne;
    case "P2"
        Mesh.Nb = (2*Nx+1)*(2*Ny+1);
    case "Q1"
        Mesh.Nb = Mesh.Np;
    case "Q1b"
        Mesh.Nb = Mesh.Np + Mesh.Ne;
    case "Q2"
        Mesh.Nb = (2*Nx+1)*(2*Ny+1);
end

end
